<?php
/**
 * Describe:
 * Source:
 * User: blue
 * Time: 2018/3/17 18:47
 */

namespace app\admin\model;


use think\Model;

class Member extends Model
{
    protected $name='member';
    protected $autoWriteTimestamp = true;

    public function getStatusAttr($value){
        $status=[0=>"否",1=>"是"];
        return $status[$value];
    }
    public function getUpdateTimeAttr($value){
        return date('Y-m-d H:i:s',$value);
    }
    public function getIsSuperAttr($value){
        $status=[0=>"否",1=>"是"];
        return $status[$value];
    }
    // 定义多对多关联
    public function groupRel(){
        return $this->belongsToMany('Group','auth_group_access','group_id','uid');
    }
}